<?php
require_once '../includes/include_dao.php';
$tag = DAOFactory::getTagDAO()->load($_GET['tag']);
$template = $tag->template;

if ($_GET['action'] == 'delete' && !empty($_GET['tag'])) :

	DAOFactory::getTagDAO()->delete($_GET['tag']); 
	$url = '/template.php?action=delete&template=' . $template;

else :

	$url = '/template.php?action=error&template=' . $template;

endif;

header(sprintf('Location: %s', $url));
?>
